home *** CD-ROM | disk | FTP | other *** search
- Path: holland.tessi.com!not-for-mail
- From: paulb@holland.tessi.com (Paul Blattner)
- Newsgroups: comp.lang.c++
- Subject: Re: Binary IOStreams?
- Date: 5 Jan 1996 08:30:15 -0800
- Organization: Quality Software Engineering, Inc.
- Message-ID: <4cjjmn$73i@holland.tessi.com>
- References: <DKny36.A0@BearRiver.com> <4ch1ei$63g@overload.lbl.gov>
- NNTP-Posting-Host: holland.tessi.com
-
- In article <4ch1ei$63g@overload.lbl.gov>, E. J. Moler <EJMOLER@LBL.GOV> wrote:
- >According to "The Draft Standard C++ Library" by P. J. Plauger,
- >one can create streams with mode arguments that determine the
- >characteristics of the stream.
- >For example, to open a binary file with filename s,
- >
- > ifstream fin(s, ios::binary);
- >
- >There are other modes that can be or'd into the second argument that
- >do things like append to an ofstream, etc.
- >
- >So the functionality that you want is probably already there.
- >
- >
- Unfortunately, this doesn't do what we want. The ios::binary flag only
- insures that on DOS / windows paltforms, newline characters don't get
- expanded to CR/LF pairs on output and CR/LF doesn't get combined to
- a newline on input. On UNIX platforms, it has no effect at all.
-
- What's more, the result is still ASCII representation of data in
- the file.
-
- I suggest that you look at Rogue Wave's Tools.h++ library which
- augments the language by providing a new set of stream classes
- called virtual streams. These classes provide
-
- - true, binary I/O streams
- or
- - network based streams built on the XDR protocol,
- and in the new Net.h++
- - TCP/IP based streams.
-
- Paul.
-
- =======================================================================
- QSE, Inc. The Successful Transition Seminar
- PO Box 303 Training and mentoring in:
- Beaverton OR 97075 C++
- (503) 538-8256 Tools.h++
- --
- Quality Software Engineering, Inc. The Successful Transition Seminar
- PO Box 303 "Helping companies make a successful
- Beaverton OR 97075 transition to object technology"
- (503) 538-8256 Training in C++ and Tools.h++
-